package com.ruben.vistor.example.insurance;

/**
 * 银行
 *
 * @author <achao1441470436@gmail.com>
 * @since 2021/7/18 15:14
 */
public class Bank implements Building {

    private String name;

    public Bank(String name) {
        this.name = name;
    }

    /**
     * 获取建筑名字
     *
     * @return java.lang.String
     * @author <achao1441470436@gmail.com>
     * @since 2021/7/18 15:48
     */
    @Override
    public String getName() {
        return name;
    }

    /**
     * 到达建筑
     *
     * @author <achao1441470436@gmail.com>
     * @since 2021/7/18 15:58
     */
    @Override
    public void arrived() {
        System.out.println("到达" + getName());
    }

    public void setName(String name) {
        this.name = name;
    }

    /**
     * 访问、拜访建筑
     *
     * @param person 访问者。人
     * @author <achao1441470436@gmail.com>
     * @since 2021/7/18 14:19
     */
    @Override
    public void beVisited(Person person) {
        person.visit(this);
    }
}
